#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton *myButton = new QPushButton(this);
    myButton->setText("hello world");
    myButton->move(100,100);

    connect(myButton,&QPushButton::clicked,this,&Widget::handleClicked);
}

void Widget::handleClicked()
{
    this->setWindowTitle("按钮已经点击");
}

Widget::~Widget()
{
    delete ui;
}

